package ddu.com.myconfig;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @author:zhangxia
 * @createTime: 2018/4/20 9:43
 * @version:1.0
 * @desc:装配后处理器
 */
@Slf4j
public class MyBeanPostProcessor implements BeanPostProcessor{
    @Override
    public Object postProcessBeforeInitialization(Object o, String s) throws BeansException {
        log.info("后处理器：初始化方法之前执行:{}",o.getClass().getName());
        return o;
    }

    @Override
    public Object postProcessAfterInitialization(Object o, String s) throws BeansException {
        log.info("后处理器：初始化方法之后执行:{}",o.getClass().getName());
        return o;
    }
}
